import React, {useState} from 'react'

export default function Counter() {
let [value, updateValue] = useState(0);
  return (
    <div className='counter'>
        <button onClick={()=> updateValue(value++)}>加</button>
        <button onClick={()=> updateValue(value--)}>减</button>
        <button onClick={()=> updateValue(value = 0)}>重置</button>
        {value}
    </div>
  )
}
